<?php
/* @var $this CreditController */
/* @var $model Credit */

$this->pageTitle=Yii::app()->name . ' - Quản lý Credit';

$this->breadcrumbs=array(
	'Quản lý Credit',
);

$this->menu=array(
	array('label'=>'Thêm Credit', 'url'=>array('create')),
);

Yii::app()->clientScript->registerScript('search', "
$('.search-button').click(function(){
	$('.search-form').toggle();
	return false;
});
$('.search-form form').submit(function(){
	$.fn.yiiGridView.update('credit-grid', {
		data: $(this).serialize()
	});
	return false;
});
");
?>

<h1>Quản lý thông tin Credit</h1>

<?php echo CHtml::link('Tìm kiếm nâng cao','#',array('class'=>'search-button')); ?>
<div class="search-form" style="display:none">
<?php $this->renderPartial('_search',array(
	'model'=>$model,
)); ?>

</div><!-- search-form -->
<br>
<?php echo CHtml::link('Thêm Credit',array('credit/create')); ?>
<?php $this->widget('zii.widgets.grid.CGridView', array(
	'id'=>'credit-grid',
	'dataProvider'=>$model->search(),
	'filter'=>$model,
	'columns'=>array(
		 array(
        'header'=>'STT',
        'value'=>'$this->grid->dataProvider->pagination->currentPage * $this->grid->dataProvider->pagination->pageSize + ($row+1)',
      ),
		 array(
        'header'=>'Usser',
        'value'=>'$data->tbuser->username',
      ),
		'sodu',
		array(
			'class'=>'CButtonColumn',
		),
	),
)); ?>
